<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
set_time_limit(0);
$intBT = intval($_data["Bet_Type"]);
$intGID = intval($_data["GambleID"]);
$arrOdds = $_data["arrOdds"];
$arrStake = $_data["arrStake"];
$isSpecial = trim($_data["isSpecial"]);
$intMemID = intval($_data["MemID"]);
$strSerialNo = trim($_data["SerialNo"]);
$intSpecialNumType = intval($_data["SpecialNumType"]);

if($intSpecialNumType == 2)$intBT = 28;

//檢驗傳入資料
if($intBT < 1 || $intGID < 1 || $intLottoID < 1 || !is_array($arrOdds) || !is_array($arrStake) || $intMemID <= 0 || $strSerialNo == ""){
	$GLOBALS["errormessage"] = "Data Error!!";
	$GLOBALS["errorhidden"] = "\nBetType:".$intBT."\nGambleID:".$intGID."\nLottoID:".$intLottoID."\narrOdds:".is_array($arrOdds)."\narrStake:".is_array($arrStake)."\nMemID:".$intMemID."\nSerialNo:".$strSerialNo."\nLine:".__LINE__."\nPage:".__FILE__;
	AddData_Log($_SESSION["Admin_Info"] -> ID, "階層補貨下注失敗 ", "Multi".print_r($_data, true));
	ErrMsgOutputHTML("Error", "", 1);
}


foreach($arrStake as $intNum => $flStake){
	if(empty($flStake))continue;
	$flOdds = floatval($arrOdds[$intNum]);
	$intOID = intval($arrOID[$intNum]);
	$flStake = floatval($flStake);
	if(empty($flOdds))continue;
	if($flStake < 0 || $flOdds < 0)continue;

	$arrCheckKey = split(" ", microtime());
	$arrR = RealSuppleWager($intLottoID, $intLType, $intGID, $intBT, $intNum, $flStake, $intOID, $flOdds, "", "", "", $arrCheckKey[0],  $arrCheckKey[1]+1);
	if($arrR["isWager"] == false){
		$arrResult["WagerCon"] .= "<br />Number : ".$intNum."<br />".$arrR["WagerCon"];
		continue;
	}
} //foreach($arrStake as $intNum => $flStake) //


AddData_Log($_SESSION["Admin_Info"] -> ID, "階層補貨下注成功 ", "Multi".print_r($arrResult["WagerCon"], true).print_r($_data, true));
?>